<?php
/**
 *
 *
 *
 */
namespace Yz\modules\Users;

class Action_SelectByLogin
    extends \Yz\modules\Generic\Action_Select
    implements \Yz_Action_Interface
{

    /**
     *  @var string
     */
    protected $login;

    /**
     *  set the login to search user by
     *
     *  @todo check login length
     *  @param string $login != ""
     *  @return chainable
     */
    public function setLogin( $login )
    {
        debug();
        $this->login = \Yz_String::testNotEmpty($login);
        return $this;
    }

    /**
     *  Modified SELECT statement creator
     *
     */
    protected function buildSelect()
    {
        $sql = parent::buildSelect();
        $sql
            ->where("login=:_login")
            ->bind("_login", $this->login);
        return $sql;
    }


}
